package article2.builder;

/**
 * 馅料内置的半月型比萨
 * 可以定制酱汁放里面外面
 *
 * @author cctv
 */
public class Calzone extends Pizza {
    /**
     * 酱汁是否放里面
     */
    private final boolean sauceInside;


    public static class Builder extends Pizza.Builder<Builder> {

        /**
         * 默认外面放酱汁
         */
        private boolean sauceInside = false;

        public Builder sauceInside() {
            sauceInside = true;
            return this;
        }

        @Override
        public Calzone build() {
            return new Calzone(this);
        }

        @Override
        protected Builder self() {
            return this;
        }
    }

    /**
     * 私有构造器
     * @param builder
     */
    private Calzone(Builder builder) {
        super(builder);
        sauceInside = builder.sauceInside;
    }

}
